
 
<div class="car">
<?php
   // $pid=$_GET['pid'];
    $key=("key");
    $c_id=$_GET['c_id'];
    $theid=$c_id;
    $car=$_GET['car'];
    if(empty($c_id)){
    	die();
    }
	$curl = curl_init();



    echo"<style>

#i".$c_id.",#i".$car."{

    display: block;
                      width: 100%;
                      height: 30px;
                      background: #f3f3f3;
                      /* background-size: 30px 30px;
                      background-image:url(/img/jjj.png);
                      background-position:0px 0px;
                      background-repeat:no-repeat;*/
                      border: solid 1px #bfbfbf;

                      line-height: 30px;
}

    </style>";











	 curl_setopt_array($curl, array(
	//  CURLOPT_URL => "http://apis.haoservice.com/lifeservice/car/GetModel/?id=".$pid."&".$key,
	  CURLOPT_URL => "http://apis.haoservice.com/lifeservice/car/GetModel/?id=".$c_id."&key=".$key,
	  CURLOPT_RETURNTRANSFER => true,
	  CURLOPT_ENCODING => "",
	  CURLOPT_MAXREDIRS => 10,
	  CURLOPT_TIMEOUT => 30,
	  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
	  CURLOPT_CUSTOMREQUEST => "GET",
	));

	$response = curl_exec($curl);
	$err = curl_error($curl);

	curl_close($curl);











	if ($err) {
	  echo "cURL Error #:" . $err;
	  exit;
	} else { //获取到了数据
	  $obj = json_decode($response,true);

	/*
	  foreach ($obj['result']['List'] as $key => $value) {
	  	echo "<div class=\"car_body\">";
	  	echo "车型分类ID:". $value['I'].' &nbsp;'; 
	  	echo "<li class=\"car_show\">车型分类名称 : ". $value['N'].' </li>&nbsp;';
	  	
	  	foreach($value['List'] as $k => $value2){
	  		echo "年份 ：". $value2['I'].'<br>';

	  		foreach ($value2['List'] as $m => $value3) {
	  			echo "<div class=\"car_a\">";
		  		echo "车型ID :".$value3['I'].' &nbsp;';
		  		echo "<li>车型名称：" .$value3['N'].'</li> &nbsp;';
		  		echo "<li>指导价：" .$value3['P'].'</li> &nbsp;';
		  		echo "</div>";
	  		}
	  		
	  	
	  		echo "</div>";
	  	}
	  	echo "<br>";
	  	echo "</div>";
	  }


*/

	  foreach ($obj['result']['List'] as $key => $value) {
	  	echo "<div class='car_body'>";
	  
	  	echo "<span class='car_show'>". $value['N'].' </span>';
	  	
	  	foreach($value['List'] as $k => $value2){
	  		echo "<div class='car_list'>  
	  		<span class='s_year'>年份 ：". $value2['I'].'</span>';

	  		foreach ($value2['List'] as $m => $value3) {
	  			echo "<div class='car_a'>";
		  	
		  		echo "<span class='car_name'>
		  		<a href='/index.php?s=photo&car=".$value3['I']."&theid=".$id."#i".$c_id."'>
		  		" .$value3['N'].'</a></span>';

		  		echo "<span class='car_price'>指导价：" .$value3['P'].'</span>';
		  		echo "</div>";
	  		}
	  		
	  	
	  		echo "</div>";
	  	}
	  
	  	echo "</div>";
	  }













    }






/*

   $mysqli=new mysqli("localhost","root","root","msu");
   $result=mysqli_query($mysqli,"SELECT * FROM `dr_1_photo` WHERE title='".$id."' ");
   while($res=mysqli_array_fetch($result)){
         $theid=$res['id'];
   }


*/








?>
</div>













